package thread;

/**
 * 线程提供了一个静态方法:
 * static Thread currentThread()
 * 该方法可以获取运行这个方法的线程
 */
public class CurrentThreadDemo {
    public static void main(String[] args) {
        Thread main = Thread.currentThread();
        System.out.println("主线程"+main);
        dosome();
    }

    private static void dosome() {
        Thread t = Thread.currentThread();
        System.out.println("dosome线程"+t);
    }
}
